<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport"
    content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>3</title>
  <!-- <link rel="shortcut icon" href="favicon.ico" /> -->

  <link rel="stylesheet" href="../../css/common.css">
  <link rel="stylesheet" href="../../css/3.css">
  <link rel="stylesheet" href="../../css/bootstrap/bootstrap.min.css" />
  <link rel="stylesheet" href="../../css/toastr.min.css" />
  <link rel="stylesheet" href="../../css/vant.min.css" />
</head>

<body>
  <!-- 版心 -->
  <div id="main">
    <!-- 内容 -->
    <div class="content">

      <!-- 头部区域 -->
      <div class="head">
        <div class="row">
          <div class="col">
            <!-- 医生姓名 -->
            <div class="doctor-info">
              <div class="image">
                <div class="text">医生</div>
                <img src="../../images/doctor_image.png" title="医生" alt="doctor_image" />
              </div>
              <div class="id">
                <div class="text">{{patientInfo.doctorId}}</div>
                <div class="name">{{patientInfo.doctorName}}</div>
              </div>
            </div>
          </div>
          <div class="col">
            <!-- 患者姓名 -->
            <div class="patient-info">
              <div class="image">
                <!-- @click="testADD" -->
                <div class="text">患者</div>
                <img src="../../images/patient_image.png" title="患者" alt="patient_image" />
              </div>
              <div class="id">
                <div class="text">{{decryption(patientInfo.patientId)}}</div>
                <div class="name">{{decryption(patientInfo.name)}}</div>
              </div>
            </div>
          </div>
        </div>
        <!-- 操作按钮组 -->
        <!-- <div class="action-btn-group">
                    <button type="button" @click="changePatient" id="select-patient">选择患者<svg viewBox="0 0 24 24"><path d="M20.118 3H3.893A2.914 2.914 0 0 0 1.39 7.371L9.506 20.92a2.917 2.917 0 0 0 4.987.005l8.11-13.539A2.914 2.914 0 0 0 20.117 3z"/></svg></button>
                    <button type="button" id="add-patient" class="hidden">新增患者<svg viewBox="0 0 1408 1408"><path d="M1408 608v192q0 40-28 68t-68 28H896v416q0 40-28 68t-68 28H608q-40 0-68-28t-28-68V896H96q-40 0-68-28T0 800V608q0-40 28-68t68-28h416V96q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68"/></svg></button>
                </div> -->

      </div>
      <!-- 操作按钮组 -->
      <div class="row addButtonGroup">
        <!-- <div class="col"> <button type="button" @click="changePatient" id="select_patient">选择患者<svg viewBox="0 0 24 24">
              <path
                d="M20.118 3H3.893A2.914 2.914 0 0 0 1.39 7.371L9.506 20.92a2.917 2.917 0 0 0 4.987.005l8.11-13.539A2.914 2.914 0 0 0 20.117 3z" />
            </svg></button></div> -->
        <!-- <div class="col"><button type="button" @click="addPatient" id="add_patient">新增患者<svg viewBox="0 0 1408 1408">
                    <path
                      d="M1408 608v192q0 40-28 68t-68 28H896v416q0 40-28 68t-68 28H608q-40 0-68-28t-28-68V896H96q-40 0-68-28T0 800V608q0-40 28-68t68-28h416V96q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68" />
                  </svg></button> </div> -->
      </div>
      <div class="container">
        <div class="row justify-content-center">
          <!-- 新增按钮 -->
          <div class="col-6 col-sm-4 col-md-3 col-lg-2">
            <button @click="changePatient" class="btn btn-primary w-100">
              选择患者
            </button>
          </div>
          <!-- 详情按钮 -->
          <!-- <div class="col-4 col-sm-4 col-md-3 col-lg-2">
                <button @click="addPatient" class="btn btn-info w-100">
                    新增患者
                </button>
            </div> -->
          <!-- 返回按钮 -->
          <div class="col-6 col-sm-4 col-md-3 col-lg-2">
            <button @click="backList" class="btn btn-secondary w-100">
              返回列表
            </button>
          </div>
        </div>
      </div>
      <!-- 信息录入区域（一级按钮） -->
      <div class="info">
        <h2>信息录入</h2>
        <div class="container btn-group">
          <div class="row row-cols-3">
            <div class="col" v-for="item in inspectionLevel1" :key="item.name">
              <div class="primary-btn">
                <button type="button" @click="mesageAdd(item)">{{item.name}}</button>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 显示检查项信息区域 -->
      <div id="previewer">
        <h2>已添加的检查项信息</h2>
        <!-- 循环展示已检查项目信息 -->
        <ol class="list-group list-group-numbered" style="height: 50vh;overflow-y: auto;">
          <li v-for="item in InspectionDataList"
            class="list-group-item d-flex justify-content-between align-items-start">
            <div class="ms-2 me-auto">
              <!-- patientInspectionItemInfoId -->
              <div class="fw-bold">{{item.name}}
                <span v-if="item.name != '意识水平'" style="color:rgb(255, 145, 0)">（{{item.value}}）</span>
                <span v-else style="color:rgb(255, 145, 0)">（{{item.value == 1 ? '意识清晰' : item.value == 2 ? '意识不清晰' :
                  ''}}）</span>
              </div>
              <div class="">{{item.createdBy}}</div>
              {{item.checkedDate}}
            </div>
            <span @click="inspectiondel(item)" class="badge bg-danger rounded-pill">删除</span>
          </li>
        </ol>
      </div>
    </div>
    <!-- 底部区域 -->
    <div id="footer">
      <a href="basicInfo.html">基础信息</a>
      <a href="javascript:;" class="active">生化及体征</a>
      <!-- <a href="AI_diagnosis_treament.html">AI预警</a> -->
      <a class="AIButton" href="AI_diagnosis_treament.html">
        AI预警
        <!-- <span :class="patientInfo.confirmColor == 'red' ? 'red' : patientInfo.confirmColor == 'yellow' ? 'yellow' :'no'"></span> -->
        <div class="spinner-grow text-danger" v-if="patientInfo.confirmColor == 'red'" role="status">
          <span class="visually-hidden">Loading...</span>
        </div>
        <div class="spinner-grow text-warning" v-if="patientInfo.confirmColor == 'yellow'" role="status">
          <span class="visually-hidden">Loading...</span>
        </div>
      </a>
      <a href="reviewdata.html">其它信息录入</a>
    </div>
    <!-- 模态框组件 -->
    <div class="modal fade" id="inspectionLevel1Modal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
      aria-labelledby="staticBackdropLabel" aria-hidden="true">
      <div class="modal-dialog modal-dialog-scrollable">
        <div class="modal-content">
          <div class="modal-header">
            <h1 class="modal-title fs-5" id="inspectionLevel1ModalLabel">{{inspectionLevel2Title}}信息录入</h1>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          </div>
          <div class="modal-body">
            <!-- 通过一级查询出二级 做动态循环控制 -->
            <div class="mb-3 row" v-for="(item,index) in inspectionLevel2">
              <label for="weight-time" class="col-sm-4 col-form-label">{{item.name}}：</label>
              <div class="col-sm-8">
                <!-- <input type="text" class="form-control" id="weight-time" v-model="patientInfo.name" required> -->
                <!-- <input type="number" step="1" name="weight-time" data-modal-id="basic-info-modal" /> -->
                <!-- "patientInspectionItemCreateArgList":[
                          {
                            "inspectionItemInfoId":"int //检查项主键【必须】",
                            "parentInspectionItemInfoId":"int //父检查项主键【必须】",
                            "value":"string //检查结果【必须】",
                            "checkedDate":"date //检查时间【必须】"
                          }
                        ], -->
                <!-- 意识水平 是下拉控制 -->
                <div name="weight-time">
                  <div class="input-group mb-2" v-if="item.name !='收缩压/舒张压' && item.name !='意识水平'">
                    <input type="number" v-model="item.value" class="form-control" placeholder="请输入"
                      aria-label="Username" name="weight" />
                    <span class="input-group-text" id="basic-addon2">{{item.inspectionUnit}}</span>
                  </div>
                  <div class="input-group mb-2" v-if="item.name =='意识水平'">
                    <!-- <input type="number" v-model="item.value" class="form-control" placeholder="请输入"
                      aria-label="Username" name="weight" /> -->
                    <select class="form-select" v-model="item.value" aria-label="Default select example">
                      <option value="1">意识清晰</option>
                      <option value="2">意识不清晰</option>
                    </select>
                    <span class="input-group-text" id="basic-addon2">{{item.inspectionUnit}}</span>
                  </div>
                  <div class="input-group mb-2" v-if="item.name =='收缩压/舒张压'">
                    <input type="number" v-model="item.value1" class="form-control" placeholder="请输入"
                      aria-label="Username" name="weight" />
                    <span class="input-group-text" id="basic-addon2">/</span>
                    <input type="number" v-model="item.value2" class="form-control" placeholder="请输入"
                      aria-label="Username" name="weight" />
                    <span class="input-group-text" id="basic-addon2">{{item.inspectionUnit}}</span>
                  </div>
                  <!-- <input type="datetime-local" @input="checkedDateChange($event,item,index)" v-model="item.checkedDate"
                    class="form-control" step="1" data-modal-id="basic-info-modal" /> -->
                  <input type="text" class="form-control" readonly @input="checkedDateChange($event,item,index)"
                    @click="showPicker(item,index)" placeholder="" v-model="item.checkedDate">
                </div>
              </div>
            </div>
            <!-- 日期选择器 -->
            <van-popup v-model:show="showPickerVisible" position="bottom">
              <van-datetime-picker v-model="currentDate" type="datetime" title="选择日期" :min-date="minDate"
                :max-date="maxDate" @confirm="onConfirm" @cancel="showPickerVisible = false"
                :columns-order="['year','month', 'day', 'hour','minute']" :formatter="formatter" />
            </van-popup>
          </div>
          <div class="modal-footer">
            <button type="button" @click="addPatientInspeciont" class="btn btn-primary">添加</button>
            <!-- <button type="button" class="btn btn-primary">关闭</button> -->
          </div>
        </div>
      </div>
    </div>
    <!-- 继续提交二次确认弹层 -->
    <div class="modal fade" id="confirmModaldelGoOn" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
      aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">确认操作</h4>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          </div>
          <div class="modal-body">
            {{ CheckText }}？
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal" @click="continueSubmit">无须修改</button>
            <button type="button" class="btn btn-primary" @click="toEdit">去修改</button>
          </div>
        </div>
      </div>
    </div>
    <!-- Modal -->
    <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
      aria-labelledby="staticBackdropLabel" aria-hidden="true">
      <div class="modal-dialog modal-dialog-scrollable">
        <div class="modal-content">
          <div class="modal-header">
            <h1 class="modal-title fs-5" id="staticBackdropLabel">选择患者</h1>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          </div>
          <div class="modal-body">
            <ol class="list-group list-group-numbered">
              <li @click="changePatientHander(item)" v-for="item in AllPatientList" v-show="!item.is_finished"
                class="list-group-item d-flex justify-content-between align-items-start"
                v-bind:class="{ active: item.patientInfoId == patientInfo.patientInfoId}">
                <div class="ms-2 me-auto">
                  <div class="fw-bold">{{decryption(item.patientId)}}</div>
                  {{decryption(item.name)}}<span v-if="item.isDiagnosedWithSepsis == '1' || item.isPatientDischarged == '1' || item.isPatientDie == '1'">✔</span>
                </div>
              </li>
            </ol>
          </div>
        </div>
      </div>
    </div>
    <!-- 二次确认 -->
    <!-- !-- 模态框（二次确认） -->
    <div class="modal fade" id="confirmModaldel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
      aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">确认操作</h4>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          </div>
          <div class="modal-body">
            您确定要执行此操作吗？
          </div>
          <div class="modal-footer">
            <!-- <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> -->
            <button type="button" class="btn btn-primary" @click="todel">确认</button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script type="text/javascript" src="../../js/tool/vue.js"></script>
  <script type="text/javascript" src="../../js/tool/vant.min.js"></script>
  <script type="text/javascript" src="../../js/tool/jquery.js"></script>
  <script type="text/javascript" src="../../js/tool/dayjs.min.js"></script>
  <script type="text/javascript" src="../../js/tool/toastr.min.js"></script>
  <script type="text/javascript" src="../../js/tool/bootstrap.min.js"></script>

  <script type="text/javascript" src="../../js/common.js"></script>
  <script type="text/javascript" src="../../js/mixin.js"></script>
  <script type="text/javascript" src="../../js/biochemical_signs.js"></script>
</body>

</html>